﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Reviewer.Business;
using E=Reviewer.Entities;
using Reviewer.Entities.Services;

public partial class InfoPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string pageName = Request["PageName"];
            if (!String.IsNullOrEmpty(pageName))
            {
                using (IMetadataService<E.InfoPage> service = ServiceFactory.GetMetadataService<E.InfoPage>())
                {
                    E.InfoPage infoPage = service.GetAll().FirstOrDefault(t => t.PageName.ToUpperInvariant().Equals(pageName.ToUpperInvariant()));
                    if (infoPage != null)
                    {
                        this.uiPhContent.Controls.Add(new LiteralControl(infoPage.PageData));
                    }
                }
            }
        }
    }
}